<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
      <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
	<head>
	<base href="<%=request.getContextPath()%>/">
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="css/room-info.css"/>
	</head>
	<body>
		<div class="select-room">
			<table border="1px" cellspacing="" cellpadding="">
				<tr>
					<th colspan="4">查看房间信息</th>
					
				</tr>
				<tr>
					<td>房间地址</td>
					<td>${roomInfo.address }</td>
					<td>房间户型</td>
					<td>${roomInfo.roomType.type}</td>
				</tr>
				<tr>
					<td>可容纳人数</td>
					<td>${roomInfo.capacity }</td>
					<td>已住人数</td>
					<td>${roomInfo.livenumber }</td>
				</tr>
				<tr>
					<td>房租</td>
					<td>${roomInfo.rent }元/月</td>
					<td>支付方式</td>
					<td>${roomInfo.payway }</td>
				</tr>
				<tr>
					<td>房东</td>
					<td>${roomInfo.landlord.lname }</td>
					<td>房东电话</td>
					<td>${roomInfo.landlord.tel }</td>
				</tr>
				<tr>
					<td>房间状态</td>
					<td>
					<c:if test="${roomInfo.state eq 1 }">
					正常
					</c:if>
					<c:if test="${roomInfo.state eq 2 }">
					设施损坏
					</c:if>
					</td>
					<td>房间类型</td>
					<td>
					<c:if test="${roomInfo.type eq 1 }">
					男生宿舍
					</c:if>
					<c:if test="${roomInfo.type eq 2 }">
					女生宿舍
					</c:if>
					</td>
				</tr>
				<tr>
					<td>租房日期</td>
					<td>${roomInfo.renttime }</td>
					<td colspan="2"></td>
					
				</tr>
			</table>
		</div>
		<div class="class-info">
		<c:if test="${! empty roomInfo.students }">
			<table border="1px" cellspacing="0px" cellpadding="0px">
				<tr>
					<th>学生姓名</th>
					<th>所在班级</th>
					<th>联系电话</th>
				</tr>
				<c:forEach items="${roomInfo.students }" var="stu">
				<tr>
					<td>${stu.sname}</td>
					<td>${stu.clazz.cname}</td>
					<td>${stu.tel}</td>
				</tr>
				</c:forEach>
			</table>
			</c:if>
		</div>
	</body>
</html>
